package pers.test.votemanage.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import pers.test.votemanage.controller.response.CommResponse;
import pers.test.votemanage.domain.Vote;
import pers.test.votemanage.service.VoteService;


@RestController
@Api(tags = "投票控制层")
public class VoteController {

    @Autowired
    private VoteService voteService;


    @ApiOperation(value = "生成投票",notes = "生成投票")
    @PostMapping("/insertVote")
    public CommResponse insertVote(@RequestBody Vote vote){
        voteService.insertVote(vote);
        return CommResponse.success();
    }
}
